<template>
  <div>
    <header class="header">
      <div class="title">
        <img src="../../assets/images/01_11.png" alt="" class="img_zuo" @click="fanhui" />
        <div>{{title}}监督检查计划</div>
      </div>
    </header>
    <div class="contents">
      <div class="tbale_div">
        <table class="table_1 table_head">
          <thead>
            <tr>
              <td>街道</td>
              <td>重点检查计划</td>
              <td>一般检查计划</td>
              <td>随机抽查计划</td>
            </tr>
          </thead>
        </table>
        <div class="table_box">
          <table class="table_1 ">
            <tbody>
              <tr v-for="(v,index) of list">
                <td>{{v.name}}</td>
                <td @click="btn(0,v.id,v.name)">{{v.total}}</td>
                <td @click="btn(1,v.id,v.name)">{{v.totalTwo}}</td>
                <td @click="btn(2,v.id,v.name)">{{v.totalThree}}</td>
              </tr>

            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        userId: null,
        list:[],
        title:"监督检查计划"
      };
    },
    methods: {
      fanhui() {
        sessionStorage.removeItem("jdjc_table_title");
        var rank=  sessionStorage.getItem("jdjc_table_fanhui_push")
        // this.$router.push(rank);
        this.$router.back()
      },
      btn(i,id,name){
        var info={
          active:i,
          jd:id,
          sq:null
        }
        sessionStorage.setItem("jdjc_table_title", name);
        sessionStorage.setItem("jdjc_table_active",JSON.stringify(info))
        sessionStorage.setItem("jdjc_wd_fanhui_push","/jdjc_table")
        this.$router.push("/jdjc_wd");
      },
      getdata(){
        try {
          plus.nativeUI.showWaiting("正在加载...");
        } catch (e) {
          console.log('plus问题');
        }
        this.axios.get(this.$global_msg.Url.host + '/SupervisionStatistics/selectSupervisionStatisticsByUserId?userId=' + this.userId).then(res => {
          console.log(res)
          try {
            plus.nativeUI.closeWaiting();
          } catch (e) {
            console.log('plus问题');
          }
          if (res.data.code ==200) {
            if(res.data.rows&&res.data.rows.length>0){
              this.list = res.data.rows;
            }else{
              this.list = [];
              this.$toast('暂无数据');
            }
          } else {
            this.$toast(res.data.msg);
          }
        }).catch(err=>{
             this.$terminal._error(err)
          })
      }
    },
    created() {
    },
    mounted() {
      var _this = this;
      this.userId = localStorage.getItem('userId')
      this.title=sessionStorage.getItem("jdjc_title");
      // $(".table_box").height($(".contents").height() - $(".table_head").height())
      this.getdata()

      //物理返回
      // window.addEventListener("popstate", function(){
      //   _this.fanhui();
      // }, false);
    }
  };
</script>
<style scoped>
  /* 头部开始 */
  .header {
    height: 1.8519rem;
    background: #007aff;
    padding-top: 0.8333rem;
    box-sizing: border-box;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 20;
    font-size: 0.388888rem;
  }

  .title {
    padding: 0 0.3704rem;
    display: flex;
    align-items: center;
    color: #fff;
    position: relative;
  }

  .title>div {
    width: 100%;
    font-size: 0.4444rem;
    text-align: center;
  }

  .img_zuo {
    width: 0.2593rem;
    height: 0.463rem;
  }

  /* 头部结束 */
  .contents {
    width: 100%;
    padding: 0.1852rem;
    padding-top: 2.037rem;
    height: 100vh;
    box-sizing: border-box;

  }

  .tbale_div {
    background: #7AC0FE;
    border-radius: 0.3704rem;
    overflow: hidden;

  }

  .table_box {

    overflow-y: auto;
  }

  .table_1 {
    width: 100%;
    border-collapse: collapse;

  }

  .table_1 tr>td {
    height: 1.1111rem;
    border: 1Px solid #BCDFFE;
    color: #fff;
    /* font-size: 0.2963rem; */
    font-size: 0.388888rem;
  }

  .table_1 tr>td:not(:first-child) {
    width: 2.5rem;
    text-align: center;
  }

  .table_1 tr>td:first-child {
    padding-left: 0.2778rem;
    text-align: left;
  }

  .table_head {
    margin-bottom: -1Px;
  }
</style>
